<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Document</title>
    <style>
        *{margin: 0;padding:0;box-sizing: border-box}
        #banner{
            width: 100%;
            height: 300px;
            border:solid 1px #666;
            color: rgb(46, 105, 214);
        }
    </style>
</head>
<body>
    <div id="banner"></div>

    <script>
        let banner = document.querySelector("#banner");

        banner.addEventListener('touchstart', function(){
            console.log('你触摸到了我');
            this.start = Date.now();//当前的时间戳
        })

        banner.addEventListener('click', function(){
            console.log('你点击了我');
            this.end = Date.now();
            //
            console.log(this.end - this.start);
        })
    </script>
</body>
</html>